<?php
require_once './vendor/autoload.php';
set_time_limit(0);
$socket = new \HemiFrame\Lib\WebSocket\WebSocket('localhost', '7001');
$socket->on('receive', function (\HemiFrame\Lib\WebSocket\Client $client, $data) {
    echo $data."\n";
});
$client = $socket->connect();
$data = [
    'demo' => 'something'
];
while (true) {
    $socket->sendData($client, json_encode($data));
    sleep(10);
}